/**
 * @author yaoyuan
 * @version 1.0
 * @name zjzcVotingApp.controller:HeaderCtrl
 * @description 用户登录
 */

'use strict';

angular.module('zjzcVotingApp')
  .controller('headerCtrl', ['$scope', 'userService', 'uiService', '$location', function ($scope, userService, uiService, $location) {

        $scope.logout = function() {
            uiService.CONFIRM('确定要退出吗？').then(function() {
            uiService.LOADING({method: userService.logout}).then(function(data) {
                uiService.ALERT(data.retMsg).then(function() {
                    window.location.href = 'login.html';
                });
            }, function(msg) {
                uiService.ALERT(msg);
            });

        });
        }

  }]);
